#include "servicefactory.h"

#include "applicationmanager.h"

ServiceFactory::ServiceFactory()
{
}

Service& ServiceFactory::declareService(const QString &serviceName){
    if(v_serviceMap.contains(serviceName))
        throw ApplicationManagerException("The service called " + serviceName + " already exists.");

    Service service(serviceName);

    v_serviceMap[serviceName] = service;
    return v_serviceMap[serviceName];
}
